package com.pesilo.mvc.model
{
	import com.pesilo.api.ApiLocator;
	import com.pesilo.mvc.controller.ApplicationFacade;
	import com.pesilo.mvc.model.vo.DataParamVO;
	import com.pesilo.mvc.model.vo.WatchVO;
	import com.pesilo.net.http.HttpService;
	
	import org.puremvc.as3.multicore.patterns.proxy.Proxy;

	public class WatchProxy extends Proxy
	{
		public static const NAME:String="WatchProxy";
		
		private var vo:WatchVO;
		public function WatchProxy()
		{
			super(NAME);
		}
		
		public function getWatchData():void{
			var pvo:DataParamVO=new DataParamVO(ApiLocator.WATCH_JSON_URL,__watchDataCallBack);
			HttpService.getInstance().getData(null,pvo,true);
		}
		
		private function __watchDataCallBack(data:Object):void{
			vo=new WatchVO(data);
			
			facade.sendNotification(ApplicationFacade.APP_WATCH_DATA,vo);
		}
	}
}